package cn.webestar.scms.user.api.dto.Department;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.Department;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "DepartmentUpdateDTO")
public class DepartmentUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "租户id")
    private Long cid;

    @Schema(description = "父部门")
    private Long pid;

    @Schema(description = "排序号")
    private Integer sort;

    @Schema(description = "部门编码")
    private String no;

    @Schema(description = "部门名称")
    private String name;

    @Schema(description = "创建人")
    private Long creator;

    @Schema(description = "更新人")
    private Long updater;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "状态，0：禁用，1：启用")
    private Integer status;

    @Schema(description = "备注")
    private String remark;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public Department toDO() {
        Department o = new Department();
        o.setId(id);
        o.setCid(cid);
        o.setPid(pid);
        o.setSort(sort);
        o.setNo(no);
        o.setName(name);
        o.setCreator(creator);
        o.setUpdater(updater);
        o.setCreateTime(createTime);
        o.setUpdateTime(updateTime);
        o.setStatus(status);
        o.setRemark(remark);
        return o;
    }

}
